<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateIntegralRuleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('integral_rule', function (Blueprint $table) {
            $table ->increments('id')->comment('积分规则表');
            $table ->string('intro') ->nullable() ->comment('规则名称');
            $table ->tinyInteger('day_time_type') ->default('0') ->comment('时间规则(1：day日一个周期，2：只计算一次)');
            $table ->tinyInteger('day') ->default('1') ->comment('几天执行');
            $table ->tinyInteger('every_day_num') ->default('0') ->comment('每天几次');
            $table ->integer('integral') ->nullable() ->default('0') ->comment('积分');
            $table ->string('app_title') ->nullable() ->comment('app标题');
            $table ->string('app_icon') ->nullable() ->comment('app图片');
            $table ->tinyInteger('app_show') ->nullable() ->comment('app显示1，隐藏0') ->default(0);
            $table ->text('remark') ->nullable() ->comment('规则备注');
            $table ->tinyInteger('status') ->default('0') ->comment('未启用0，启用1');
            $table ->timestamps();
            $table ->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('integral_rule', function (Blueprint $table) {
            //
        });
    }
}
